Optimal. Leaf size=69 \[ \frac {(1-i) \sqrt {a} \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right ) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {4326, 3625,
211} \begin {gather*} \frac {(1-i) \sqrt {a} \sqrt {\tan (c+d x)} \sqrt {\cot (c+d x)} \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 3625
Rule 4326
Rubi steps
\begin {align*} \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx &=\left (\sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx\\ &=-\frac {\left (2 i a^2 \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \text {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac {(1-i) \sqrt {a} \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right ) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.77, size = 118, normalized size = 1.71 \begin {gather*} -\frac {i e^{-i (c+d x)} \sqrt {-1+e^{2 i (c+d x)}} \sqrt {\frac {i \left (1+e^{2 i (c+d x)}\right )}{-1+e^{2 i (c+d x)}}} \tanh ^{-1}\left (\frac {e^{i (c+d x)}}{\sqrt {-1+e^{2 i (c+d x)}}}\right ) \sqrt {a+i a \tan (c+d x)}}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 399 vs. \(2 (56 ) = 112\).
time = 46.09, size = 400, normalized size = 5.80
method | result | size |
default | \(-\frac {\sqrt {2}\, \sqrt {\frac {\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \left (-1+\cos \left (d x +c \right )\right ) \sqrt {\frac {a \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (i \ln \left (\frac {\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}\, \sin \left (d x +c \right )+\sin \left (d x +c \right )+\cos \left (d x +c \right )-1}{-\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}\, \sin \left (d x +c \right )+\cos \left (d x +c \right )+\sin \left (d x +c \right )-1}\right )+2 i \arctan \left (\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}+1\right )+2 i \arctan \left (\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}-1\right )+2 \arctan \left (\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}+1\right )+2 \arctan \left (\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}-1\right )+\ln \left (\frac {-\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}\, \sin \left (d x +c \right )+\cos \left (d x +c \right )+\sin \left (d x +c \right )-1}{\sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {2}\, \sin \left (d x +c \right )+\sin \left (d x +c \right )+\cos \left (d x +c \right )-1}\right )\right )}{2 d \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )-1\right ) \sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}}\) | \(400\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 374 vs. \(2 (51) = 102\).
time = 0.58, size = 374, normalized size = 5.42 \begin {gather*} -\frac {\sqrt {a} {\left (-\left (2 i + 2\right ) \, \arctan \left (2 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right ) + 2 \, \sin \left (d x + c\right ), 2 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right ) + 2 \, \cos \left (d x + c\right )\right ) + \left (i - 1\right ) \, \log \left (4 \, \cos \left (d x + c\right )^{2} + 4 \, \sin \left (d x + c\right )^{2} + 4 \, \sqrt {\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1} {\left (\cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right )^{2} + \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right )^{2}\right )} + 8 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} {\left (\cos \left (d x + c\right ) \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right ) + \sin \left (d x + c\right ) \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right )\right )}\right )\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 217 vs. \(2 (51) = 102\).
time = 1.17, size = 217, normalized size = 3.14 \begin {gather*} \frac {1}{4} \, \sqrt {-\frac {8 i \, a}{d^{2}}} \log \left ({\left (\sqrt {2} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {8 i \, a}{d^{2}}} + 4 i \, a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - \frac {1}{4} \, \sqrt {-\frac {8 i \, a}{d^{2}}} \log \left ({\left (\sqrt {2} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {8 i \, a}{d^{2}}} + 4 i \, a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \sqrt {\cot {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sqrt {\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________